package de.tum.in.eist.im.client;

import java.util.List;

import com.google.gwt.user.client.rpc.AsyncCallback;

import de.tum.in.eist.im.shared.AbstractEvent;
import de.tum.in.eist.im.shared.Group;
import de.tum.in.eist.im.shared.Message;
import de.tum.in.eist.im.shared.NewMessagesChunk;
import de.tum.in.eist.im.shared.User;

public interface ChatServiceAsync {

	void getEventsBlocking(User user,
			AsyncCallback<List<AbstractEvent>> callback);

	void getHistory(Group g, AsyncCallback<List<Message>> callback);

	void getLoggedInUsers(AsyncCallback<List<User>> callback);

	void getNewMessages(long clientLastTimestamp,
			AsyncCallback<NewMessagesChunk> callback);

	void login(User user, AsyncCallback<User> callback);

	void logout(User user, AsyncCallback<Boolean> callback);

	void registerNewUser(User newUser, AsyncCallback<Boolean> asyncCallback);

	void sendMessage(Message message, String groupName, AsyncCallback<Void> callback);

	void invitePersonToGroup(String groupName, User askingUser,String invitedUser,  AsyncCallback<Void> callback);

	void acceptGroupInvite(String groupName, User acceptingUser, AsyncCallback<Void> callback);

	void createNewGroup(Group newGroup, AsyncCallback<Boolean> asyncCallback);

	void getGroupMembers(String groupName, AsyncCallback<List<User>> callback);

	void getGroups(User user, AsyncCallback<List<String>> asyncCallback);
}
